package com.xiaoshuidi.cloud.module.bpm.controller.admin.task.vo.instance;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@Schema(description = "管理后台 - 流程实例的分页 Item Response VO")
@Data
public class BpmProcessInstancePageItemRespVO {
    /**
    * 流程实例的编号
    * */
    @Schema(description = "流程实例的编号", required = true, example = "1024")
    private String id;
    /**
    * 流程名称
    * */
    @Schema(description = "流程名称", required = true, example = "合房")
    private String name;
    /**
    * 流程定义的编号
    * */
    @Schema(description = "流程定义的编号", required = true, example = "2048")
    private String processDefinitionId;
    /**
    * 流程分类
    * */
    @Schema(description = "流程分类,参见 bpm_model_category 数据字典", required = true, example = "1")
    private String category;
    /**
    * 流程实例的状态
    * */
    @Schema(description = "流程实例的状态,参见 bpm_process_instance_status", required = true, example = "1")
    private Integer status;
    /**
    * 流程实例的结果
    * */
    @Schema(description = "流程实例的结果,参见 bpm_process_instance_result", required = true, example = "2")
    private Integer result;
    /**
    * 提交时间
    * */
    @Schema(description = "提交时间", required = true)
    private LocalDateTime createTime;
    /**
    * 结束时间
    * */
    @Schema(description = "结束时间", required = true)
    private LocalDateTime endTime;

    /**
     * 变量
     */
    @TableField(typeHandler = JacksonTypeHandler.class)
    private Map<String, Object> formVariables;

    /**
     * 实例完成数
     * */
    private  Integer nrOfCompletedInstances;

    /**
     * 业务id
     * */
    private  Long processDefinitionKey;

    /**
     * 客户姓名
     * */
    private  String customerName;

    /**
     * 客户手机号
     * */
    private  String customerPhone;
    /*
     * 房间名称
     * */
    private  String roomName;
    /*
     * 类型
     * */
    private  String type;

    /**
     * 当前任务
     */
    private List<Task> tasks;

    @Schema(description = "流程任务")
    @Data
    public static class Task {
        /**
        * 流程任务的编号
        * */
        @Schema(description = "流程任务的编号", required = true, example = "1024")
        private String id;
        /**
         * 任务名称
         * */
        @Schema(description = "任务名称", required = true, example = "合房")
        private String name;

    }

}